package com.dsit.sq;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

/**
 * Created by dsit_dev04 on 2016/10/7.
 */
public class SettingsActivity extends BaseActivity implements OnClickListener{
    private ImageView returnImageView;
    private RelativeLayout wifiSettingReLayout;
    private RelativeLayout checkUpdateReLayout;
    TextView tvVersionName;
    TextView tvBuildRevision;

    @Override
    protected void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_settings);
        StatusBarBackChange.setStatusBarBack(this);
        returnImageView = (ImageView)findViewById(R.id.setting_return_button);
        returnImageView.setOnClickListener(this);
        wifiSettingReLayout = (RelativeLayout) findViewById(R.id.wifi_setting_relative);
        wifiSettingReLayout.setOnClickListener(this);
        checkUpdateReLayout = (RelativeLayout) findViewById(R.id.update_check_relative);
        checkUpdateReLayout.setOnClickListener(this);

        tvVersionName = (TextView)findViewById(R.id.version_name);
        tvVersionName.setText(BuildConfig.VERSION_NAME);
        tvBuildRevision = (TextView)findViewById(R.id.revision_string);
        tvBuildRevision.setText(R.string.build_revision);
    }

    @Override
    public void onClick(View v){
        Intent intent = new Intent();
        switch(v.getId()){
            case R.id.setting_return_button:
                finish();
                break;
            case R.id.wifi_setting_relative:
                intent.setClass(this,ChangeWifiActivity.class);
                startActivity(intent);
                break;
            case R.id.update_check_relative:
                intent.setClass(this,UpdateActivity.class);
                startActivity(intent);
                break;
            default:
                break;
        }
    }

}
